import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'
// 存放订单支付时候 选择的收货地址
export const useAddressSrore = defineStore('address', () => {
  // 存放选中的地址
  const selectedAddress = ref<AddressItem>()
  //修改选中的收货地址  传递一个参数 你要修改的那一项
  const changeAddress = (val: AddressItem) => {
    selectedAddress.value = val
  }
  return {
    selectedAddress,
    changeAddress,
  }
})
